package com.wanxi.arr;

import java.util.Arrays;
import java.util.Random;

public class MaxRandom {
    public static void main(String[] args) {
        int[] arr = new int[100000];
        long start=System.currentTimeMillis();
        System.out.println(start);

        for (int i = 0; i < arr.length; i++) {
            Random random = new Random();
//            int temp = random.nextInt(100) + 1;
            arr[i] = random.nextInt(100) + 1;
        }
        long end=System.currentTimeMillis();
        System.out.println(end);
        System.out.println(end-start);
//        System.out.println(Arrays.toString(arr));
        int max = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (max < arr[i]) {
                max = arr[i];
            }
        }
        System.out.println("数组的最大值为：" + max);
    }
}
